<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - Styling descriptions</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/fonts/fonts-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<p class='demoTitle'>inputEx - Styling descriptions</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Styling the field descriptions</p>
	
	<p>You can style the description to appear when the field is focused :</p>

	<div class='demoContainer' id='container1'></div>

	<style>
	#sampleGroup div.inputEx-description {
		display:none;
	}
	#sampleGroup div.inputEx-focused div.inputEx-description {
		display: block;
	}
	</style>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			#sampleGroup div.inputEx-description {
				display:none;
			}
			#sampleGroup div.inputEx-focused div.inputEx-description {
				display: block;
			}
		</textarea>
			</div>

</div>




<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/Group.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/SelectField.js"  type='text/javascript'></script>
<script src="../js/fields/EmailField.js"  type='text/javascript'></script>
<script src="../js/fields/UrlField.js"  type='text/javascript'></script>
<script src="../js/fields/CheckBox.js"  type='text/javascript'></script>
<script src="../js/fields/RadioField.js"  type='text/javascript'></script>
<script src="../js/fields/Textarea.js"  type='text/javascript'></script>

<script>

YAHOO.util.Event.addListener(window, 'load', function() {
	
	// Required for the UrlField
	YAHOO.inputEx.spacerUrl = "../images/space.gif";
	
	// Example 1
	var descriptedFields = [ 
			{type: 'select', inputParams: {label: 'A select', description: 'Select one',  selectValues: ['One','Two','Three'] } },
			{ inputParams: {label: 'StringField', description: 'Here is the description', value:'Jacques' } }, 
			{type:'boolean', inputParams: {description: 'Check this box if you are happy to be there', label: 'Happy to be there ?', name: 'email'}}, 
			{ type:'url', inputParams: {description: 'Your blog url', label: 'Website', name:'website'}},
			{ type: 'radio', inputParams: {label: 'Radio', description: 'My favorite is YUI', name: 'example1', choices: ['Ajaxian','YUI blog','other']}},
			{ type: 'text', inputParams: {label: 'Comments', description: 'Enter your comment'}}
	];
	new YAHOO.inputEx.Group({id:'sampleGroup', parentEl: 'container1', fields: descriptedFields, legend: 'User Informations'});
	
	
});	

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>